<template>
	<!--记事本列表-单项-->
	<view class="com-box">
		<view class="com-box-top">
			<view class="com-box-top-l">
				<view class="title">{{obj.title}}</view>
				<view class="time">{{obj.create_time | ftime}}</view>
			</view>
			<image class="com-box-top-r" :src="$mAssetsPath.icon_sc" @click.stop="del"></image>
		</view>
		<view class="com-box-cen">{{obj.content}}</view>
	</view>
</template>

<script>
	export default {
		name: "com-top",
		components: {},
		props: {
			obj: {
				type: Object,
				default () {
					return {
						id:1,
						title: '明天需采购内容',
						time:'2020.12.22',
						richtext: '橱窗背景9套；海报背景/玻璃贴各5套；易拉宝海报3张；名片需跟厂家核实价格。'
					}
				}
			}
		},
		// 过滤器
		filters: {
			ftime(value) {
				let t = ''
				if (!!value) {
					const times = value;
					t = times.split(" ")[0];
				}
				let tt = t.replace(/-/g,".")
				return tt
			}
		},
		data() {
			return {
				
			}
		},
		methods:{
			del(){
				this.$emit('del')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.com-box {
		display: flex;
		flex-direction: column;
		.com-box-top{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-bottom: 20rpx;
			.com-box-top-l{
				display: flex;
				align-items: center;
				width: calc(100% - 80rpx);
				
				.title{
					font-size: 32rpx;
					font-weight: 400;
					color: $font-color-3;
					margin-right: 20rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}
				.time{
					font-size: 32rpx;
					font-weight: 400;
					color: $font-color-9;
				}
			}
			.com-box-top-r{
				width: 28rpx;
				height: 30rpx;
			}
		}
		.com-box-cen{
			height: 100rpx;
			font-size: 28rpx;
			font-weight: 400;
			line-height: 50rpx;
			color:$font-color-9;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 2;
			-webkit-box-orient: vertical;
			display: -moz-box;
			-moz-line-clamp: 2;
			-moz-box-orient: vertical;
		}
 	}
</style>
